using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_ComInfoMap : EntityTypeConfiguration<t_ComInfo>
    {
        public t_ComInfoMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FBrNo, t.FItemID });

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FID)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.FName)
                .HasMaxLength(50);

            this.Property(t => t.FManager)
                .HasMaxLength(50);

            this.Property(t => t.FEmail)
                .HasMaxLength(50);

            this.Property(t => t.FAdd)
                .HasMaxLength(255);

            this.Property(t => t.FPhone)
                .HasMaxLength(50);

            this.Property(t => t.FFax)
                .HasMaxLength(50);

            this.Property(t => t.FZip)
                .HasMaxLength(50);

            this.Property(t => t.FIco)
                .HasMaxLength(255);

            this.Property(t => t.FContact)
                .HasMaxLength(50);

            this.Property(t => t.FBank)
                .HasMaxLength(50);

            this.Property(t => t.FTaxNum)
                .HasMaxLength(50);

            this.Property(t => t.FProperty)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("t_ComInfo");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FParentID).HasColumnName("FParentID");
            this.Property(t => t.FID).HasColumnName("FID");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FManager).HasColumnName("FManager");
            this.Property(t => t.FEmail).HasColumnName("FEmail");
            this.Property(t => t.FAdd).HasColumnName("FAdd");
            this.Property(t => t.FPhone).HasColumnName("FPhone");
            this.Property(t => t.FFax).HasColumnName("FFax");
            this.Property(t => t.FZip).HasColumnName("FZip");
            this.Property(t => t.FIco).HasColumnName("FIco");
            this.Property(t => t.FContact).HasColumnName("FContact");
            this.Property(t => t.FBank).HasColumnName("FBank");
            this.Property(t => t.FTaxNum).HasColumnName("FTaxNum");
            this.Property(t => t.FProperty).HasColumnName("FProperty");
            this.Property(t => t.FOperID).HasColumnName("FOperID");
            this.Property(t => t.FOperDate).HasColumnName("FOperDate");
            this.Property(t => t.FDeleted).HasColumnName("FDeleted");
        }
    }
}
